package com.alibaba.citrus.cr.platform.enhance.functions.inventoryAllot.entity;

import com.alibaba.citrus.cr.common.util.SpringContextUtil;
import com.alibaba.citrus.cr.platform.enhance.repository.InventoryAllotLineRepository;

import com.epoch.app.crplatformenhance.model.dto.InventoryAllotLineSDO;

public class InventoryAllotLineEntity {

    private InventoryAllotLineSDO inventoryAllotLineSDO;

    private static InventoryAllotLineRepository inventoryAllotLineRepository;

    static {
        inventoryAllotLineRepository = SpringContextUtil.getBean(InventoryAllotLineRepository.class);
    }

    public static InventoryAllotLineEntity of(InventoryAllotLineSDO inventoryAllotLineSDO) {
        InventoryAllotLineEntity inventoryAllotLineEntity = new InventoryAllotLineEntity();
        inventoryAllotLineEntity.inventoryAllotLineSDO = inventoryAllotLineSDO;
        return inventoryAllotLineEntity;
    }

    public Long updateRemainingQuantity() {
        return inventoryAllotLineRepository.update(this.inventoryAllotLineSDO);
    }

    public Long updateDistributionQuantity() {
        return inventoryAllotLineRepository.update(this.inventoryAllotLineSDO);
    }

}
